package com.cloudwise.isop.kg.dao;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.cloudwise.isop.kg.pojo.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Component
public interface UserDao {
    @DS(value = "mysql")
    @Select("SELECT roles.*, su.real_name from (select sys_role.role_name, sys_role.role_id, sys_user_role.user_id from sys_role left join sys_user_role on sys_role.role_id=sys_user_role.role_id  where role_name='经理') as roles left join sys_user su on roles.user_id = su.user_id where su.deleted_flag=1 and su.real_name!=''")
    public List<User> getUsers();
}
